package de.schall.rest.di;

import static javax.ws.rs.core.MediaType.TEXT_PLAIN;

import javax.inject.Inject;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;

@Path("/talker")
public class SaySomething {
	
	private Human mensch;

	@Inject
	public SaySomething(Human mensch) {
		this.mensch = mensch;
		
	}
	
	@GET
	@Produces({TEXT_PLAIN})
	public Response hello() {
		return Response.ok("Ich habs Drauf??! " + mensch.toString()).build();
	}
	
	@GET
	@Path("/error")
	@Produces({TEXT_PLAIN})
	public Response throwSomeThing() throws PokemonException {
		throw new PokemonException("Error");
	}
	
	public SaySomething() {
		
	}
}
